﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;

namespace ClasesLibreria.dao
{
    static class DAOPruebas
    {
        public static void insertar(string bar, string connectionString)
        {
            SqlConnection con;
            SqlTransaction tra;
            SqlCommand cmd;
            SqlDataReader rdr;


            con = new SqlConnection();
            con.ConnectionString = connectionString;
            con.Open();

            tra = con.BeginTransaction();

            cmd = new SqlCommand("", con, tra);
            cmd.Parameters.Add(new SqlParameter("@id", 5));

            int filasAfectadas = cmd.ExecuteNonQuery();

            cmd.CommandText = "";
            rdr = cmd.ExecuteReader();

            while (rdr.Read())
            {
                int id = rdr.GetInt16(0);
                string nombre = rdr.GetString(1);
            }




            tra.Commit();
            con.Close();


        }
    }
}
